﻿@model  IEnumerable<WebVideo.EntityListQuestionOfUser  >
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-1.7.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-ui-1.8.16.custom.min.js")" type="text/javascript"></script>

<script type="text/javascript">
   
    $(function () {
        $('.stdtable a.delete').click(function () {
            var c = confirm('Continue delete?');
            if (c) jQuery(this).parents('tr').fadeOut(function () {

                var id = $(this).closest('tr').find('td:eq(0)').text();
                var getURL = '@Url.Action("Delete", "TypeVideo")';

                $.get(getURL, { "id": id }, function (data) {
                    if (data == "error") //error
                    {
                        $('#nofError').show();
                        $('#nofSuccess').hide();
                        $('#msgNofError').text("Cannot Delete Record");
                    }
                    else {
                        jQuery(this).remove();
                        $('#nofError').hide();
                        $('#nofSuccess').show();
                        $('#msgNofSuccess').text("Delete Record Ok");
                    }
                });
            });
            return false;
        });
     });
</script>
<div class="maincontentinner">
    <ul class="maintabmenu">
        <li class="current"><a href="#" onclick="javascript: history.back(); return false" >Quay lại</a></li>
    </ul>
    <!--maintabmenu-->
    <div class="notification msgsuccess" style="display: none" id="nofSuccess">
        <a class="close"></a>
        <p id="msgNofSuccess">This is a success message.</p>
    </div>
    <!-- notification msgsuccess -->

    <div class="notification msgerror" style="display: none" id="nofError">
        <a class="close"></a>
        <p id="msgNofError">This is an error message.</p>
    </div>
    <!-- notification msgerror -->

    <div class="contenttitle radiusbottom0">
        <h2 class="table"><span>List Type Video</span></h2>
    </div>
     @*  <div class="tableoptions">
        <span>Search theo đáp án: </span>
        <select class="radius3" id="CbBoxStatus">
              <option value="">Tất cả</option>
             <option value="a">Đáp án a</option>
             <option value="b">Đáp án b</option>
             <option value="c">Đáp án c</option>
             <option value="d">Đáp án d</option>
        </select>
        &nbsp;
    </div>*@
    <!--contenttitle-->
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable" id="dyntable">
        <colgroup>
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
        </colgroup>
        <thead>
            <tr>
               
                <th class="head0">Tên người dùng</th>
               <th class="head1">Đáp án</th>
                <th class="head0">Date</th>
            </tr>
           
        </thead>
        <tfoot>
            <tr>
               
                <th class="head0">Tên người dùng</th>
               <th class="head1">Đáp án</th>
                <th class="head0">Date</th>
            </tr>
           
        </tfoot>
        <tbody>
            @{
                foreach (var item in Model)
                {
                <tr class="gradeX">
                    <td>
                        @Html.DisplayFor(modelitem => item.UserName )
                    </td>
                    <td>
                        @Html.DisplayFor(modelitem => item.Result )
                    </td>
                    <td>
                      @Html.DisplayFor(modelitem => item.Date )
                    </td>
                </tr> 
               
                }                      
            }
        </tbody>
    </table>
</div>
<!--maincontentinner-->
<script type="text/javascript"  src="@Url.Content("~/Content/cssAdmin/js/custom/tables.js")" ></script>
<script type="text/javascript"  src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery.dataTables.min.js")" ></script>
<script>

    $(document).ready(function () {
      
        var table = jQuery("#dyntable").dataTable({
            "bDestroy": true,
            "bProcessing": true,
            "sPaginationType": "full_numbers",
       
            "iDisplayLength": 100
        });
     
    });

    //$("#CbBoxStatus").change(function () {
    //    $("#dyntable").dataTable().fnFilter(this.value);
    //});

</script>
